/**
 * 跨省销售用产地检疫申报单(动物A)
 * @constructor
 */
function SaleDeclarationA() {
}

SaleDeclarationA.init = function () {
    getTown();
    selectBatchNumber();
    initAnimalSelect();
    $('#tableList').bootstrapTable({
        url: '/saleDeclarationA/tableSearch',
        method: 'post',
        striped: true, //是否显示行间隔色
        toolbar: "#toolbar",
        sidePagination: "true",
        dataField: "data",//这是返回的json数组的key.默认是"rows".这里只有前后端约定好就行
        showToggle: true, //是否显示详细视图和列表视图的切换按钮
        striped: true, // 是否显示行间隔色
//search : "true",
        uniqueId: "id",
        pageList: [5, 10, 20, 50, 100],//可选择单页记录数
        pageSize: "10",
        pagination: true, // 是否分页
        sortable: true, // 是否启用排序
        sidePagination: 'server', // 设置为服务器端分页     客户端：client
        search: false,
        showColumns: true,
        showRefresh: true,
        showExport: true,
//得到查询的参数
        queryParams: function (params) {
//这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
            var query_params = {
//********table的参数 不变
                pageSize: params.limit,                         //页面大小
                pageIndex: (params.offset / params.limit) + 1,   //页码
                sort: params.sort,      //排序列名
                sortOrder: params.order, //排位命令（desc，asc）
//********
//获取查询的对象，往下加入
                timeInterval: $('#search_SaleDate').val(), // 请求时向服务端传递的参数
                types: $('#search_types').val(), // 请求时向服务端传递的参数
            };
            return query_params;
        },
        columns: [
            {
//field: 'Number',//可不加
                title: '序号',//标题  可不加
                align: "center",
                width: 40,
                formatter: function (value, row, index) {
                    var pageSize = $('#tableList').bootstrapTable('getOptions').pageSize;//通过表的#id 可以得到每页多少条
                    var pageNumber = $('#tableList').bootstrapTable('getOptions').pageNumber;//通过表的#id 可以得到当前第几页
                    return pageSize * (pageNumber - 1) + index + 1;//返回每条的序号： 每页条数 * （当前页 - 1 ）+ 序号
                }
            },
            {field: 'build', title: '养殖档案是否建立', align: 'center'},
            {field: 'owners', title: '畜主', align: 'center'},
            {field: 'phone', title: '联系电话', align: 'center'},
            {field: 'buyer', title: '购买人', align: 'center'},
            {field: 'buyerPhone', title: '购买人电话', align: 'center'},
            {field: 'animalType', title: '饲养动物种类', align: 'center'},
            {field: 'saleAnimalType', title: '销售动物种类', align: 'center'},
            {field: 'batchNumber', title: '批次号', align: 'center'},
            {field: 'number', title: '数量', align: 'center'},
            {field: 'starEar', title: '起始耳标号', align: 'center'},
            {field: 'endEar', title: '结束耳标号', align: 'center'},
            {field: 'starAddress', title: '启运地点', align: 'center'},
            {field: 'village', title: '村', align: 'center'},
            {field: 'nowAddress', title: '当前地点', align: 'center'},
            {field: 'arriveCityName', title: '到达省、市(州)名称', align: 'center'},
            {field: 'arriveTownName', title: '到达县乡村名称', align: 'center'},
            {field: 'purpose', title: '用途', align: 'center'},
            {field: 'carry', title: '承运人', align: 'center'},
            {field: 'carryPhone', title: '承运人电话', align: 'center'},
            {field: 'transportation', title: '运载方式', align: 'center'},
            {field: 'drug', title: '运载工具消毒药品', align: 'center'},
            {
                field: 'animalPhoto', title: '动物状态照片', align: 'center', width: 200,
                formatter: function (value) {
                    return "<a href='"+value+"' target='_blank'>查看图片</a>";
                    // return "<img src=\"" + value + "\" class=\"img-responsive\">";
                }
            },
            {
                field: 'carPhoto', title: '运载车辆图片', align: 'center', width: 200,
                formatter: function (value) {
                    return "<a href='"+value+"' target='_blank'>查看图片</a>";
                    // return "<img src=\"" + value + "\" class=\"img-responsive\">";
                }
            },
            {
                field: 'pigCarPhoto', title: '生猪运输车辆备案表', align: 'center', width: 200,
                formatter: function (value) {
                    return "<a href='"+value+"' target='_blank'>查看图片</a>";
                    // return "<img src=\"" + value + "\" class=\"img-responsive\">";
                }
            },
            {field: 'saleDate', title: '销售时间', align: 'center'},
            {
                field: 'certificatePhoto', title: '农产品合格证/追溯码', align: 'center', width: 200,
                formatter: function (value) {
                    return "<a href='"+value+"' target='_blank'>查看图片</a>";
                    // return "<img src=\"" + value + "\" class=\"img-responsive\">";
                }
            },
            {field: 'remark', title: '备注', align: 'center'},
            {
                field: 'types', title: '审批状态', align: 'center',
                formatter:function (value) {
                    if (value == 0) return "待审";
                    else if (value == 1) return "驳回";
                    else if (value == 2) return "待出证";
                    else if (value == 3) return "已出证";
                }
            },
            {
                title: '操作',
                align: 'center',
                formatter: function (value, row, index) {
                    var optionHtml = "";
                    if (row.types == 1){ //驳回
                        optionHtml = optionHtml + "<a class=\"btn btn-success btn-xs\"  href=\"javascript:void(0)\"  onclick='actionRecord(" + JSON.stringify(row) + ",\"edit\")' title=\"重新提交\" ><i class=\"fa fa-edit\"></i>重新提交</a>";
                        optionHtml = optionHtml + " <a class=\"btn btn-danger btn-xs\" href=\"javascript:void(0)\"  onclick='actionRecord(" + JSON.stringify(row) + ",\"delete\")'  title=\"删除\"><i class=\"fa fa-remove\"></i>删除</a>"
                    }
                    optionHtml = optionHtml + "<a class=\"btn btn-info btn-xs\"  href=\"javascript:void(0)\"  onclick='actionRecord(" + JSON.stringify(row) + ",\"show\")' title=\"查看详情\" ><i class=\"fa\"></i>查看详情</a>";
                    return optionHtml;

                }
            }
        ]
    });
}
//动物种类下拉选生成
function initAnimalSelect() {
    $('#text_saleAnimalType').empty();
    console.log("动物种类",$("#k").val())
    if($("#k").val()==1){
        $('#text_saleAnimalType').append("<option value='种公畜'>种公畜</option>");
        $('#text_saleAnimalType').append("<option value='后备母畜'>后备母畜</option>");
        $('#text_saleAnimalType').append("<option value='能繁母畜'>能繁母畜</option>");
        $('#text_saleAnimalType').append("<option value='哺乳牲畜'>哺乳牲畜</option>");
        $('#text_saleAnimalType').append("<option value='保育牲畜'>保育牲畜</option>");
        $('#text_saleAnimalType').append("<option value='育成牲畜'>育成牲畜</option>");
    }else{
        $('#text_saleAnimalType').append("<option value='存栏家禽'>存栏家禽</option>");
    }
}
//时间选择器
laydate.render({
    elem: '#text_saleDate',
    theme: 'molv',
    type: "date",
});
laydate.render({
    elem: '#search_SaleDate',
    range: true,
});

function getTown() {
    $.ajax({
        type: "post",
        url: "/town/getTownByDistrictSession",
        dataType : "json",
        contentType: "application/json",
        success: function (data, status) {
            //清空
            $("#text_starAddress").empty();
            //将城市赋值给下拉列表
            $.each(data,function (index,value) {
                $("#text_starAddress").append("<option value='"+value.town__name+"'>"+value.town__name+"</option>");
            })
        }
    });
}

//查询方法****************************
function doSearch() {
// $('#tableList').bootstrapTable(('refresh')); // 很重要的一步，刷新url！
    $("#tableList").bootstrapTable("refreshOptions", {pageNumber: 1});
}

//重置****************************
function doRest() {
    $("#search_SaleDate").val("");
    $("#search_types").val("");
// $('#tableList').bootstrapTable(('refresh')); // 很重要的一步，刷新url！
    $("#tableList").bootstrapTable("refreshOptions", {pageNumber: 1});
}

//增加方法****************************
var Action = "";
var id = 0;
var pxt = "/saleDeclarationA"; //控制器名称
function addRecord() {
    id = 0;
    Action = "add";
    $("#myform")[0].reset();

}

//增加/修改数据保存****************************
function saveRecord() {
    let purpose = "";
    $.each($("#text_purpose input[type=checkbox]:checked"), function () {
        purpose += $(this).val() + ","
    })
    purpose = purpose.substring(0, purpose.length - 1)
    if (!validateForm()) return false;
//创建传递的参数
    var postdata = {
        id: id,
        action: Action,

        build: $("#text_build").val(),
        owners: $("#text_owners").val(),
        phone: $("#text_phone").val(),
        buyer: $("#text_buyer").val(),
        buyerPhone: $("#text_buyerPhone").val(),
        animalType: $("#text_animalType").val(),
        number: $("#text_number").val(),
        starEar: $("#text_starEar").val(),
        endEar: $("#text_endEar").val(),
        starAddress: $("#text_starAddress").val(),
        village: $("#text_village").val(),
        nowAddress: $("#text_nowAddress").val(),
        arriveCityName: $("#text_arriveCityName").val(),
        arriveTownName: $("#text_arriveTownName").val(),
        purpose: purpose,
        carry: $("#text_carry").val(),
        carryPhone: $("#text_carryPhone").val(),
        transportation: $("#text_transportation").val(),
        drug: $("#text_drug").val(),
        animalPhoto: animalPhoto,
        carPhoto: carPhoto,
        pigCarPhoto: pigCarPhoto,
        saleDate: $("#text_saleDate").val(),
        certificatePhoto: certificatePhoto,
        remark: $("#text_remark").val(),
        saleAnimalType: $("#text_saleAnimalType").val(),
        batchNumber: $("#text_batchNumber").find("option:selected").text(),
        aid: $("#text_batchNumber").val(),
    };
// console.log(JSON.stringify(postdata));
//发送异步请求到后台保存用户数据
    $.ajax({
        url: pxt + (Action == "add" ? "/save" : "/update"),
        type: "post",
        data: JSON.stringify(postdata),
        contentType: "application/json",
        dataType: "json",
        success: function (data) {
            if (data.code === "200") {
                $('#myModalAdd').modal('hide')
                doSearch();
                swal("操作成功!",data.message, "success");
            }else {
                swal("操作失败!", data.message, "error");
            }
        }
    });
}

//操作相关方法****************************
function actionRecord(data, type) {
    httpAnimalPhoto = data.animalPhoto;
    httpCarPhoto = data.carPhoto;
    httpPigCarPhoto = data.pigCarPhoto;
    httpCertificatePhoto=data.certificatePhoto;
    if (type == "edit") {
//修改
        id = data.id;
        Action = "edit";
        $("#myform")[0].reset();
        $("#save").removeAttr("disabled");
        WriteData(data)
        $('#myModalAdd').modal('show')
    } else if (type == "delete") {
//删除
        swal({
            title: "确认是否删除",
            text: "是否确认要删除该条记录？",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "删除",
            cancelButtonText: "取消",
            closeOnConfirm: false
        }, function () {
//点击删除之后此处进行传递后台
            $.ajax({
                type: "delete",
                url: pxt + "/deleteById/" + data.id,
                dataType: "json",
                contentType: "application/json",
                success: function (data, status) {
                    if (data.code == "200") {
                        doSearch();
                        swal("删除成功!", "请继续操作", "success");
                    } else {
                        swal("删除失败!", "请重试", "error");
                    }
                }
            });

        });
    }else if (type == "show"){ //详情
        id = data.id;
        Action = "show";
        $("#myform1")[0].reset();
        WriteData1(data)
        $('#myModalAdd1').modal('show')
    }
}
function WriteData1(data) {
    $("#build").val(data.build);
    $("#owners").val(data.owners);
    $("#phone").val(data.phone);
    $("#buyer").val(data.buyer);
    $("#buyerPhone").val(data.buyerPhone);
    $("#animalType").val(data.animalType);
    $("#number").val(data.number);
    $("#starEar").val(data.starEar);
    $("#endEar").val(data.endEar);
    $("#starAddress").val(data.starAddress);
    $("#saleAnimalType").val(data.saleAnimalType);
    $("#purpose").val(data.purpose);
    $("#village").val(data.village);
    $("#nowAddress").val(data.nowAddress);
    $("#arriveCityName").val(data.arriveCityName);
    $("#arriveTownName").val(data.arriveTownName);
    $("#carry").val(data.carry);
    $("#carryPhone").val(data.carryPhone);
    $("#transportation").val(data.transportation);
    $("#drug").val(data.drug);
    $("#Image").attr("src", httpAnimalPhoto);
    $("#Image2").attr("src", httpCarPhoto);
    $("#Image3").attr("src", httpPigCarPhoto);
    $("#Image4").attr("src", httpCertificatePhoto);
    $("#saleDate").val(data.saleDate);
    $("#remark").val(data.remark);
    $("#aprovalUser").val(data.aproval);
    $("#aprovalTime").val(data.aprovalTime);
    $("#aprovalOpinion").val(data.opinion);
    $("#certificateUser").val(data.certificate);
    $("#certificateTime").val(data.certificateTime);
    $("#certificateUserName").val(data.witness);
    $("#livestockName").val(data.livestock);
    let types = "";
    if (data.types == 0) types = "待审";
    else if (data.types == 1) types = "驳回";
    else if (data.types == 2) types = "待出证";
    else if (data.types == 3) types = "已出证";
    $("#aprovalType").val(types);
}
//给下拉选赋值
function selectBatchNumber(aid) {
    $.ajax({
        type: "post",
        url: "/setday/selectBatchNumber",
        dataType : "json",
        contentType: "application/json",
        success: function (data, status) {
            //清空
            $("#text_batchNumber").empty();
            //将批次号赋值给下拉列表
            $.each(data.data,function (index,value) {
                if(aid==value.id){
                    $("#text_batchNumber").append("<option value='"+value.id+"' selected>"+value.batchNumber+"</option>");
                }else{
                    $("#text_batchNumber").append("<option value='"+value.id+"'>"+value.batchNumber+"</option>");
                }
            })
        }
    });
}
//给控件赋值****************************
function WriteData(data) {
    selectBatchNumber(data.aid);
    $("#text_build").val(data.build);
    $("#text_owners").val(data.owners);
    $("#text_phone").val(data.phone);
    $("#text_buyer").val(data.buyer);
    $("#text_buyerPhone").val(data.buyerPhone);
    $("#text_animalType").val(data.animalType);
    $("#text_number").val(data.number);
    $("#text_starEar").val(data.starEar);
    $("#text_endEar").val(data.endEar);
    $("#text_starAddress").val(data.starAddress);

    $("#text_saleAnimalType").val(data.saleAnimalType);
    /**
     * 无法全部清空再赋值
     */
    $.each(data.purpose.split(","), function (index, object) {
        $.each($('#text_purpose input[type=checkbox]'), function () {
            if (object == $(this).val()) {
                $(this).prop("checked", true);
            }
        });
    })
    $("#text_village").val(data.village);
    $("#text_nowAddress").val(data.nowAddress);
    $("#text_arriveCityName").val(data.arriveCityName);
    $("#text_arriveTownName").val(data.arriveTownName);
    $("#text_carry").val(data.carry);
    $("#text_carryPhone").val(data.carryPhone);
    $("#text_transportation").val(data.transportation);
    $("#text_drug").val(data.drug);
    var strs = data.animalPhoto.split("/");
    var str = strs[strs.length - 1];
    animalPhoto = str;
    document.getElementById("showImage").style.display = "block";
    $("#showImage").attr("src", httpAnimalPhoto);

    var strs2 = data.carPhoto.split("/");
    var str2 = strs2[strs2.length - 1];
    carPhoto = str2;
    document.getElementById("showImage2").style.display = "block";
    $("#showImage2").attr("src", httpCarPhoto);

    var strs3 = data.pigCarPhoto.split("/");
    var str3 = strs3[strs3.length - 1];
    pigCarPhoto = str3;
    document.getElementById("showImage3").style.display = "block";
    $("#showImage3").attr("src", httpPigCarPhoto);

    var strs4 = data.certificatePhoto.split("/");
    var str4 = strs4[strs4.length - 1];
    certificatePhoto = str4;
    document.getElementById("showImage4").style.display = "block";
    $("#showImage4").attr("src", httpCertificatePhoto);

    $("#text_saleDate").val(data.saleDate);
    $("#text_remark").val(data.remark);
}

var animalPhoto = "";//动物上传图片路径
var httpAnimalPhoto = "";//动物上传图片完整路径
//上传****************************
function ImportShipmentStatusList() {
    console.log("进入图片上传方法")
    var upname = "text_animalPhoto";
    if ($("#" + upname).val() == "") {
        alert("请选择上传图片");
        return;
    }
    $.ajaxFileUpload({
        url: pxt + '/uploadImages',
        secureuri: false,
        fileElementId: upname,
        dataType: 'json',
        success: function (data, status) {
            animalPhoto = data.url;
            //图片回显
            $("#showImage").css("display", "");
            $("#showImage").attr("src", data.httpUrl);
        },
        error: function (data, status, e) {
            console.log("上传图片失败", e);
        }
    });
}

var carPhoto = "";//运载车辆图片路径
var httpCarPhoto = "";//运载车辆图片完整路径
//上传****************************
function ImportShipmentStatusList2() {
    console.log("进入图片上传方法")
    var upname = "text_carPhoto";
    if ($("#" + upname).val() == "") {
        alert("请选择上传图片");
        return;
    }
    $.ajaxFileUpload({
        url: pxt + '/uploadImages',
        secureuri: false,
        fileElementId: upname,
        dataType: 'json',
        success: function (data, status) {
            carPhoto = data.url;
            //图片回显
            $("#showImage2").css("display", "");
            $("#showImage2").attr("src", data.httpUrl);
        },
        error: function (data, status, e) {
            console.log("上传图片失败", e);
        }
    });
}

var pigCarPhoto = "";//生猪运输车辆备案表图片路径
var httpPigCarPhoto = "";//生猪运输车辆备案表图片完整路径
//上传****************************
function ImportShipmentStatusList3() {
    console.log("进入图片上传方法")
    var upname = "text_pigCarPhoto";
    if ($("#" + upname).val() == "") {
        alert("请选择上传图片");
        return;
    }
    $.ajaxFileUpload({
        url: pxt + '/uploadImages',
        secureuri: false,
        fileElementId: upname,
        dataType: 'json',
        success: function (data, status) {
            pigCarPhoto = data.url;
            //图片回显
            $("#showImage3").css("display", "");
            $("#showImage3").attr("src", data.httpUrl);
        },
        error: function (data, status, e) {
            console.log("上传图片失败", e);
        }
    });
}

var certificatePhoto = "";//农产品合格证图片路径
var httpCertificatePhoto = "";//农产品合格证图片完整路径
//上传****************************
function ImportShipmentStatusList4() {
    console.log("进入图片上传方法")
    var upname = "text_certificatePhoto";
    if ($("#" + upname).val() == "") {
        alert("请选择上传图片");
        return;
    }
    $.ajaxFileUpload({
        url: pxt + '/uploadImages',
        secureuri: false,
        fileElementId: upname,
        dataType: 'json',
        success: function (data, status) {
            certificatePhoto = data.url;
            //图片回显
            $("#showImage4").css("display", "");
            $("#showImage4").attr("src", data.httpUrl);
        },
        error: function (data, status, e) {
            console.log("上传图片失败", e);
        }
    });
}

//表单验证*****************************
function validateForm() {
//validate方法参数可选
    return $("#myform").validate({
        rules: {

            text_build: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_owners: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_phone: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_animalType: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_number: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_starEar: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_endEar: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_starAddress: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_village: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_nowAddress: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_arriveCityName: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_arriveTownName: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_purpose: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_carry: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_carryPhone: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_transportation: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_drug: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_saleDate: {
                required: true,//必填
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },

        },
//错误信息提示
        messages: {
            text_build: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_owners: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_phone: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_animalType: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_number: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_starEar: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_endEar: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_starAddress: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_village: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_nowAddress: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_arriveCityName: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_arriveTownName: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_purpose: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_carry: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_carryPhone: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_transportation: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_drug: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
            text_saleDate: {
                required: "(必填)",
                minlength: 1, //最少1个字符
                maxlength: 50,//最多50个字符
                // number: true, //必须是数字
            },
        },
    }).form();

}
